<?php

class BaseException extends Exception implements JsonSerializable{

    public function __construct($message = null, $code = 0){
        parent::__construct($message, $code);
    }

    public function jsonSerialize(){

        return [
            'status' => [
                'code' => $this->getCode(),
                'message' => $this->getMessage()
            ]
        ];
    }
    
}